<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="renderer" content="webkit">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

	<title>活动安全监管平台</title>

	<meta name="keywords" content="声纹识别,多维身份认证,中证宝科技,声纹采集仪,声纹采集终端,声纹采集设备,声纹采集器">
	<meta name="description" content="中证宝科技，是一家高科技创新型企业，基于人工智能技术的多维身份识别与认证一站式系统集成服务及技术提供商。公司专注于生物识别领域，掌握了世界领先的人工智能与机器学习算法，在声纹识别、语音识别、人脸识别、关键词检索、语种识别、音频指纹、活体检测等方面，中证宝拥有完全自主知识产权。">

	<link rel="stylesheet" href="a/css/a.css">
	<link rel="stylesheet" href="a/css/cong.css">


  <link rel="stylesheet" media="screen" href="index.files/css/style.css">
  <link rel="stylesheet" type="text/css" href="index.files/css/reset.css">

</head>
<body>

<div id="particles-js">
	<div class="login">
		<div class="login-top">
			活动安全监管平台
		</div>
		<div class="login-center clearfix">
			<div class="login-center-img"><img src="index.files/img/name.png"/></div>
			<div class="login-center-input">
				<input type="text" placeholder="请输入您的用户名" onfocus="this.placeholder=''" onblur="this.placeholder='请输入您的用户名'" v-model="post.account">
				<div class="login-center-input-text">用户名</div>
			</div>
		</div>
		<div class="login-center clearfix">
			<div class="login-center-img"><img src="index.files/img/password.png"/></div>
			<div class="login-center-input">
				<input type="password" placeholder="请输入您的密码" onfocus="this.placeholder=''" onblur="this.placeholder='请输入您的密码'" v-model="post.password">
				<div class="login-center-input-text">密码</div>
			</div>
		</div>
		<div class="login-button" @click="登录()">
			登录
		</div>
	</div>
	<div class="sk-rotating-plane"></div>
</div>


	<script src="a/plugin/jquery.js"></script>
	<script src="a/plugin/vue.js"></script>
	<script src="a/js/a.js"></script>

<script src="index.files/js/particles.min.js"></script>
<script src="index.files/js/app.js"></script>

<script>
var app = new Vue({
	el: '#particles-js',
	data:{
		post: {
			account: '',
			password: '',
		}
	},
	methods:{
		登录(){

			var data = {
				reqHead:
				{
					clientType: 1,
					format: "json",
					version: "1.0",
					sign: "UCR1fIQ9lyUCR1fIQ9lyUCR1fIQ9lyUCR1y"
				},
				reqBody: this.post
			}

			$.ajax({
				type:	'POST',
				url:	mp_api + 'mp/tokenGenerate/interface',
				data:	JSON.stringify(data),
				dataType: 'json',
				success: function(re){

					LS.mchId = re.rspBody.adminResponseInfoDTO.primaryAccountId


					var data = {
						reqHead:
						{
							clientType: 1,
							format: "json",
							version: "1.0",
							sign: "UCR1fIQ9lyUCR1fIQ9lyUCR1fIQ9lyUCR1y"
						},
						reqBody: {
							mchId: LS.mchId
						}
					}

					$.ajax({
						type:	'POST',
						url:	api + 'getMchDisposeInfo/interface',
						data:	JSON.stringify(data),
						dataType: 'json',
						success: function(re2){

							if(re2.rspHead.retCode != 1){

								alert('帐户或密码错误')

							}else{

								LS.startTime	= re2.rspBody.startTime
								LS.endTime		= re2.rspBody.endTime

								// 中间日期
								var date_list = []

								var date = new Date(LS.startTime)
								var in_date = ''
								var time = 0;

								while(in_date != LS.endTime){

									// 取得 YYYY-MM-DD
									in_date = date.getFullYear()
									+ '-' +
									(
										Array(2).join('0') + (date.getMonth() + 1)
									).slice(-2)
									+ '-' +
									(
										Array(2).join('0') + date.getDate()
									).slice(-2)

									// 插入
									date_list.push(in_date)

									// 加一天
									date = new Date(date.setDate(date.getDate() + 1))

									time++
									if(time > 30) break // 最多30天
								}


								// console.log(date_list)
								LS.date_list = JSON.stringify(date_list)
								

								location.href = 'main.html'
							}
						}
					})
				}
			})

		},
	},
	mounted(){
		console.log('vue ready')
	}
})
</script>

</body>
</html>